/*
 * Copyright 2009-2009 Tiago da Fonseca Frazao  All rights reserved.
 */

package mz.co.research.shared.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * @author Tiago da Fonseca Frazao
 */
@Entity
@Table(name = "ROLE")
public class Role extends UpdatableEntity {

	public static final String ROLE_ADMIN = "ROLE_ADMIN";

	public static final String ROLE_USER = "ROLE_USER";

	@Column(name = "CODE", length = 50, nullable = false)
	private String code;

	@Column(name = "DESCRIPTION", length = 1000, nullable = false)
	private String description;

	public Role() {
	}

	/**
	 * @return the code
	 */
	public String getCode() {
		return code;
	}

	/**
	 * @param code
	 *            the code to set
	 */
	public void setCode(String code) {
		this.code = code;
	}

	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * @param description
	 *            the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	@Override
	public String toString() {
		StringBuilder buffer = new StringBuilder("\nRole");

		buffer.append(super.toString());

		buffer.append("\ncode        :" + this.code);
		buffer.append("\ndescription :" + this.description);

		return buffer.toString();
	}
}
